<html>
    <head>
        <meta charset="utf-8">
        
            <script src="lib/bindings/utils.js"></script>
            <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis-network/9.1.2/dist/dist/vis-network.min.css" integrity="sha512-WgxfT5LWjfszlPHXRmBWHkV2eceiWTOBvrKCNbdgDYTHrT2AeLCGbF4sZlZw3UMN3WtL0tGUoIAKsu8mllg/XA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
            <script src="https://cdnjs.cloudflare.com/ajax/libs/vis-network/9.1.2/dist/vis-network.min.js" integrity="sha512-LnvoEWDFrqGHlHmDD2101OrLcbsfkrzoSpvtSQtxK3RMnRV0eOkhhBN2dXHKRrUU8p2DGRTk35n4O8nWSVe1mQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
            
        
<center>
<h1></h1>
</center>

<!-- <link rel="stylesheet" href="../node_modules/vis/dist/vis.min.css" type="text/css" />
<script type="text/javascript" src="../node_modules/vis/dist/vis.js"> </script>-->
        <link
          href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css"
          rel="stylesheet"
          integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6"
          crossorigin="anonymous"
        />
        <script
          src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js"
          integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf"
          crossorigin="anonymous"
        ></script>


        <center>
          <h1></h1>
        </center>
        <style type="text/css">

             #mynetwork {
                 width: 100%;
                 height: 800px;
                 background-color: #ffffff;
                 border: 1px solid lightgray;
                 position: relative;
                 float: left;
             }

             

             
             #config {
                 float: left;
                 width: 400px;
                 height: 600px;
             }
             

             
        </style>
    </head>


    <body>
        <div class="card" style="width: 100%">
            
            
            <div id="mynetwork" class="card-body"></div>
        </div>

        
        
            <div id="config"></div>
        

        <script type="text/javascript">

              // initialize global variables.
              var edges;
              var nodes;
              var allNodes;
              var allEdges;
              var nodeColors;
              var originalNodes;
              var network;
              var container;
              var options, data;
              var filter = {
                  item : '',
                  property : '',
                  value : []
              };

              

              

              // This method is responsible for drawing the graph, returns the drawn network
              function drawGraph() {
                  var container = document.getElementById('mynetwork');

                  

                  // parsing and collecting nodes and edges from the python
                  nodes = new vis.DataSet([{"group": "Statement", "id": 0, "label": "Statement\nSELECT id, name FROM", "level": 0, "shape": "dot", "title": "SELECT id, name FROM users WHERE age \u003e 18"}, {"group": "Token", "id": 1, "label": "Token\nSELECT", "level": 1, "shape": "dot", "title": "SELECT"}, {"group": "Token", "id": 2, "label": "Token\n ", "level": 1, "shape": "dot", "title": " "}, {"group": "IdentifierList", "id": 3, "label": "IdentifierList\nid, name", "level": 1, "shape": "dot", "title": "id, name"}, {"group": "Identifier", "id": 4, "label": "Identifier\nid", "level": 2, "shape": "dot", "title": "id"}, {"group": "Token", "id": 5, "label": "Token\nid", "level": 3, "shape": "dot", "title": "id"}, {"group": "Token", "id": 6, "label": "Token\n,", "level": 2, "shape": "dot", "title": ","}, {"group": "Token", "id": 7, "label": "Token\n ", "level": 2, "shape": "dot", "title": " "}, {"group": "Identifier", "id": 8, "label": "Identifier\nname", "level": 2, "shape": "dot", "title": "name"}, {"group": "Token", "id": 9, "label": "Token\nname", "level": 3, "shape": "dot", "title": "name"}, {"group": "Token", "id": 10, "label": "Token\n ", "level": 1, "shape": "dot", "title": " "}, {"group": "Token", "id": 11, "label": "Token\nFROM", "level": 1, "shape": "dot", "title": "FROM"}, {"group": "Token", "id": 12, "label": "Token\n ", "level": 1, "shape": "dot", "title": " "}, {"group": "Identifier", "id": 13, "label": "Identifier\nusers", "level": 1, "shape": "dot", "title": "users"}, {"group": "Token", "id": 14, "label": "Token\nusers", "level": 2, "shape": "dot", "title": "users"}, {"group": "Token", "id": 15, "label": "Token\n ", "level": 1, "shape": "dot", "title": " "}, {"group": "Where", "id": 16, "label": "Where\nWHERE age \u003e 18", "level": 1, "shape": "dot", "title": "WHERE age \u003e 18"}, {"group": "Token", "id": 17, "label": "Token\nWHERE", "level": 2, "shape": "dot", "title": "WHERE"}, {"group": "Token", "id": 18, "label": "Token\n ", "level": 2, "shape": "dot", "title": " "}, {"group": "Comparison", "id": 19, "label": "Comparison\nage \u003e 18", "level": 2, "shape": "dot", "title": "age \u003e 18"}, {"group": "Identifier", "id": 20, "label": "Identifier\nage", "level": 3, "shape": "dot", "title": "age"}, {"group": "Token", "id": 21, "label": "Token\nage", "level": 4, "shape": "dot", "title": "age"}, {"group": "Token", "id": 22, "label": "Token\n ", "level": 3, "shape": "dot", "title": " "}, {"group": "Token", "id": 23, "label": "Token\n\u003e", "level": 3, "shape": "dot", "title": "\u003e"}, {"group": "Token", "id": 24, "label": "Token\n ", "level": 3, "shape": "dot", "title": " "}, {"group": "Token", "id": 25, "label": "Token\n18", "level": 3, "shape": "dot", "title": "18"}, {"group": "Statement", "id": 26, "label": "Statement\nSELECT user_id, full", "level": 0, "shape": "dot", "title": "SELECT user_id, fullname FROM customers WHERE years \u003e 18"}, {"group": "Token", "id": 27, "label": "Token\nSELECT", "level": 1, "shape": "dot", "title": "SELECT"}, {"group": "Token", "id": 28, "label": "Token\n ", "level": 1, "shape": "dot", "title": " "}, {"group": "IdentifierList", "id": 29, "label": "IdentifierList\nuser_id, fullname", "level": 1, "shape": "dot", "title": "user_id, fullname"}, {"group": "Identifier", "id": 30, "label": "Identifier\nuser_id", "level": 2, "shape": "dot", "title": "user_id"}, {"group": "Token", "id": 31, "label": "Token\nuser_id", "level": 3, "shape": "dot", "title": "user_id"}, {"group": "Token", "id": 32, "label": "Token\n,", "level": 2, "shape": "dot", "title": ","}, {"group": "Token", "id": 33, "label": "Token\n ", "level": 2, "shape": "dot", "title": " "}, {"group": "Identifier", "id": 34, "label": "Identifier\nfullname", "level": 2, "shape": "dot", "title": "fullname"}, {"group": "Token", "id": 35, "label": "Token\nfullname", "level": 3, "shape": "dot", "title": "fullname"}, {"group": "Token", "id": 36, "label": "Token\n ", "level": 1, "shape": "dot", "title": " "}, {"group": "Token", "id": 37, "label": "Token\nFROM", "level": 1, "shape": "dot", "title": "FROM"}, {"group": "Token", "id": 38, "label": "Token\n ", "level": 1, "shape": "dot", "title": " "}, {"group": "Identifier", "id": 39, "label": "Identifier\ncustomers", "level": 1, "shape": "dot", "title": "customers"}, {"group": "Token", "id": 40, "label": "Token\ncustomers", "level": 2, "shape": "dot", "title": "customers"}, {"group": "Token", "id": 41, "label": "Token\n ", "level": 1, "shape": "dot", "title": " "}, {"group": "Where", "id": 42, "label": "Where\nWHERE years \u003e 18", "level": 1, "shape": "dot", "title": "WHERE years \u003e 18"}, {"group": "Token", "id": 43, "label": "Token\nWHERE", "level": 2, "shape": "dot", "title": "WHERE"}, {"group": "Token", "id": 44, "label": "Token\n ", "level": 2, "shape": "dot", "title": " "}, {"group": "Comparison", "id": 45, "label": "Comparison\nyears \u003e 18", "level": 2, "shape": "dot", "title": "years \u003e 18"}, {"group": "Identifier", "id": 46, "label": "Identifier\nyears", "level": 3, "shape": "dot", "title": "years"}, {"group": "Token", "id": 47, "label": "Token\nyears", "level": 4, "shape": "dot", "title": "years"}, {"group": "Token", "id": 48, "label": "Token\n ", "level": 3, "shape": "dot", "title": " "}, {"group": "Token", "id": 49, "label": "Token\n\u003e", "level": 3, "shape": "dot", "title": "\u003e"}, {"group": "Token", "id": 50, "label": "Token\n ", "level": 3, "shape": "dot", "title": " "}, {"group": "Token", "id": 51, "label": "Token\n18", "level": 3, "shape": "dot", "title": "18"}]);
                  edges = new vis.DataSet([{"arrows": "to", "color": "#FF6B6B", "from": 0, "to": 1}, {"arrows": "to", "color": "#FF6B6B", "from": 0, "to": 2}, {"arrows": "to", "color": "#FF6B6B", "from": 0, "to": 3}, {"arrows": "to", "color": "#FF6B6B", "from": 3, "to": 4}, {"arrows": "to", "color": "#FF6B6B", "from": 4, "to": 5}, {"arrows": "to", "color": "#FF6B6B", "from": 3, "to": 6}, {"arrows": "to", "color": "#FF6B6B", "from": 3, "to": 7}, {"arrows": "to", "color": "#FF6B6B", "from": 3, "to": 8}, {"arrows": "to", "color": "#FF6B6B", "from": 8, "to": 9}, {"arrows": "to", "color": "#FF6B6B", "from": 0, "to": 10}, {"arrows": "to", "color": "#FF6B6B", "from": 0, "to": 11}, {"arrows": "to", "color": "#FF6B6B", "from": 0, "to": 12}, {"arrows": "to", "color": "#FF6B6B", "from": 0, "to": 13}, {"arrows": "to", "color": "#FF6B6B", "from": 13, "to": 14}, {"arrows": "to", "color": "#FF6B6B", "from": 0, "to": 15}, {"arrows": "to", "color": "#FF6B6B", "from": 0, "to": 16}, {"arrows": "to", "color": "#FF6B6B", "from": 16, "to": 17}, {"arrows": "to", "color": "#FF6B6B", "from": 16, "to": 18}, {"arrows": "to", "color": "#FF6B6B", "from": 16, "to": 19}, {"arrows": "to", "color": "#FF6B6B", "from": 19, "to": 20}, {"arrows": "to", "color": "#FF6B6B", "from": 20, "to": 21}, {"arrows": "to", "color": "#FF6B6B", "from": 19, "to": 22}, {"arrows": "to", "color": "#FF6B6B", "from": 19, "to": 23}, {"arrows": "to", "color": "#FF6B6B", "from": 19, "to": 24}, {"arrows": "to", "color": "#FF6B6B", "from": 19, "to": 25}, {"arrows": "to", "color": "#4D96FF", "from": 26, "to": 27}, {"arrows": "to", "color": "#4D96FF", "from": 26, "to": 28}, {"arrows": "to", "color": "#4D96FF", "from": 26, "to": 29}, {"arrows": "to", "color": "#4D96FF", "from": 29, "to": 30}, {"arrows": "to", "color": "#4D96FF", "from": 30, "to": 31}, {"arrows": "to", "color": "#4D96FF", "from": 29, "to": 32}, {"arrows": "to", "color": "#4D96FF", "from": 29, "to": 33}, {"arrows": "to", "color": "#4D96FF", "from": 29, "to": 34}, {"arrows": "to", "color": "#4D96FF", "from": 34, "to": 35}, {"arrows": "to", "color": "#4D96FF", "from": 26, "to": 36}, {"arrows": "to", "color": "#4D96FF", "from": 26, "to": 37}, {"arrows": "to", "color": "#4D96FF", "from": 26, "to": 38}, {"arrows": "to", "color": "#4D96FF", "from": 26, "to": 39}, {"arrows": "to", "color": "#4D96FF", "from": 39, "to": 40}, {"arrows": "to", "color": "#4D96FF", "from": 26, "to": 41}, {"arrows": "to", "color": "#4D96FF", "from": 26, "to": 42}, {"arrows": "to", "color": "#4D96FF", "from": 42, "to": 43}, {"arrows": "to", "color": "#4D96FF", "from": 42, "to": 44}, {"arrows": "to", "color": "#4D96FF", "from": 42, "to": 45}, {"arrows": "to", "color": "#4D96FF", "from": 45, "to": 46}, {"arrows": "to", "color": "#4D96FF", "from": 46, "to": 47}, {"arrows": "to", "color": "#4D96FF", "from": 45, "to": 48}, {"arrows": "to", "color": "#4D96FF", "from": 45, "to": 49}, {"arrows": "to", "color": "#4D96FF", "from": 45, "to": 50}, {"arrows": "to", "color": "#4D96FF", "from": 45, "to": 51}]);

                  nodeColors = {};
                  allNodes = nodes.get({ returnType: "Object" });
                  for (nodeId in allNodes) {
                    nodeColors[nodeId] = allNodes[nodeId].color;
                  }
                  allEdges = edges.get({ returnType: "Object" });
                  // adding nodes and edges to the graph
                  data = {nodes: nodes, edges: edges};

                  var options = {
    "configure": {
        "enabled": true,
        "filter": [
            "physics"
        ]
    },
    "edges": {
        "color": {
            "inherit": true
        },
        "smooth": {
            "enabled": true,
            "type": "dynamic"
        }
    },
    "interaction": {
        "dragNodes": true,
        "hideEdgesOnDrag": false,
        "hideNodesOnDrag": false
    },
    "physics": {
        "enabled": true,
        "stabilization": {
            "enabled": true,
            "fit": true,
            "iterations": 1000,
            "onlyDynamicEdges": false,
            "updateInterval": 50
        }
    }
};

                  


                  
                  // if this network requires displaying the configure window,
                  // put it in its div
                  options.configure["container"] = document.getElementById("config");
                  

                  network = new vis.Network(container, data, options);

                  

                  

                  


                  

                  return network;

              }
              drawGraph();
        </script>
    </body>
</html>